/*
 *  Copyright 2009 Advanced Industrial Science and Technology (AIST).
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

/*! \file
 *  \brief
 */

// thrust, includes
#include <thrust/graph/adjacency_list.hpp>
#include <thrust/graph/simple_io.hpp>
using namespace thrust;

// stl, includes
#include <iostream>
using namespace std;

int
main( int argc, char** argv)
{

  typedef no_property VertexProperty;
  //typedef no_property EdgeProperty;
  typedef property<edge_weight_t,float> EdgeProperty;

  typedef adjacency_list<undirectedS,disallow_parallelS,
    VertexProperty,EdgeProperty> graph_t;
  
  typedef graph_traits<graph_t>::vertex_descriptor vertex_descriptor;
  typedef graph_traits<graph_t>::edge_descriptor edge_descriptor;
  typedef graph_traits<graph_t>::edge_iterator edge_iterator;
  unsigned int N =10;
  unsigned int M =3;
  graph_t g( N, M);
  
  bool inserted;
  edge_descriptor e;
  
  thrust::tie( e, inserted) =add_edge( 6, 4, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;

  thrust::tie( e, inserted) =add_edge( 6, 3, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;

  thrust::tie( e, inserted) =add_edge( 0, 7, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;

  thrust::tie( e, inserted) =add_edge( 0, 1, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;

  thrust::tie( e, inserted) =add_edge( 1, 0, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;
  
  thrust::tie( e, inserted) =add_edge( 0, 1, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;
  
  remove_edge( 1, 0, g);
  
  /*thrust::tie( e, inserted) =add_edge( 1, 3, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;

  thrust::tie( e, inserted) =add_edge( 3, 7, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;

  thrust::tie( e, inserted) =add_edge( 2, 4, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;

  thrust::tie( e, inserted) =add_edge( 1, 0, g);
  std::cout <<"edge: "<< e <<", inserted: " <<inserted <<std::endl;
  
  clear_vertex( 3, g);*/

  std::cout <<g <<std::endl;

  return 0;
}
